package org.hackystat.ui.projectviewer.gwt.client.panels;

import org.hackystat.ui.projectviewer.gwt.client.CSSStyles;
import org.hackystat.ui.projectviewer.gwt.client.ProjectViewer;
import org.hackystat.ui.projectviewer.gwt.client.common.MainPanelWidget;

import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;

/**
 * The 'about' panel which displayed on the page load.
 *
 * @author Pavel Senin.
 *
 */
public class AboutPanel extends MainPanelWidget {

  /* The HTML displayed on the panel */
  private final HTML about = new HTML("<p>This application is the part of HackyStat v.8 system "
      + "developed using GWT-based widgets.</p>"
      + "<p>Visit <a href=\"http://code.google.com/p/hackystat/\"> "
      + "Hackystat Home<a/> for more information.");

  /* the outer frame */
  private HorizontalPanel outer = new HorizontalPanel();

  /**
   * Creates an instance and reports a handler.
   *
   * @param parent The handler top the "parent" window.
   *
   * @return the widget handler.
   */
  public static MPHandler init(final ProjectViewer parent) {
    return new MPHandler("aboutPanel") {
      public MainPanelWidget createInstance() {
        return new AboutPanel(parent);
      }
    };
  }

  /**
   * Creates the actual panel instance.
   *
   * @param parent The handler top the "parent" window.
   */
  public AboutPanel(ProjectViewer parent) {
    outer.setStyleName(CSSStyles.MANAGEMENT_PANEL_ABOUT);
    outer.add(about);
    initWidget(outer);
  }

}
